gtkwindow: Fix "shadowed" checks for GTK grabs
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 17 May 2021 21:57:17 +0000 (23:57 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Mon, 17 May 2021 22:16:55 +0000 (00:16 +0200)
commit6b7b23211483abb1aa80f1439915b1de2eedd5ec
treec5733e00e0cac7f692d5be254ba7986413d8c0b0
parent0a5d21ca9e234137ff488bbd6379330108eb218a
gtkwindow: Fix "shadowed" checks for GTK grabs

We iterate here from the target widget up the toplevel checking
for the previous and new grab, there's however 2 bugs here:
- The check for is_shadowed was different to the check for was_shadowed
- The loop started with the assumption that the widgets did not hold
  a grab, just to change it if the grab widget was found. (or maybe
  it's the other way around? it's unclear with the differing checks
  for past/present state).

Make these checks consistent, and ensure we start with the right
assumption for the past/present grabbing state, and accounting that
new/old grab widgets may or may not be part of the pick stack.
gtk/gtkwindow.c